from PyQt4 import QtGui,QtCore

class ItemIconData(QtCore.QObject):
    def __init__(self,IconName,parent=None):
        super(ItemIconData,self).__init__()
        self.IconName=IconName
        self.Default=QtGui.QPixmap('images/items/' + self.IconName)
        self.temp=self.Default.toImage()
        # create a grayscale image
        for i in range(self.temp.width()):
            for j in range(self.temp.height()):
                col = self.temp.pixel(i,j)
                gray = QtGui.qGray(col)
                self.temp.setPixel(i,j,QtGui.qRgb(gray,gray,gray))
        self.DefaultGrayScale=QtGui.QPixmap().fromImage(self.temp)
        scalefactor=0.7
        self.Small=self.Default.scaled(self.Default.size().width()*scalefactor, self.Default.size().height()*scalefactor)
        self.SmallGrayScale=self.Default.scaled(self.Default.size().width()*scalefactor, self.Default.size().height()*scalefactor)
        